﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class AdvertMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.Advert>
    {
        public AdvertMap()
        {
            // table
            //ToTable("CMS_Advert");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)

                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.SiteName)

                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.UserName)

                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Contact)

                .HasMaxLength(200)
                .IsOptional();
            Property(t => t.AdUrl)

                .HasMaxLength(300)
                .IsOptional();
            Property(t => t.Url)

                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Width)

                .IsRequired();
            Property(t => t.Height)

                .IsRequired();
            Property(t => t.Target)

                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.MaxShowTime)

                .IsRequired();
            Property(t => t.MaxClick)

                .IsRequired();
            Property(t => t.MaxDateTime)

                .IsRequired();
            Property(t => t.Show)

                .IsOptional();
            Property(t => t.Clicks)

                .IsOptional();
            Property(t => t.UpDateTime)

                .IsRequired();
            Property(t => t.ShowType)

                .IsOptional();
            Property(t => t.Remark)

                .HasMaxLength(1000)
                .IsOptional();
            Property(t => t.IsStop)

                .IsRequired();
            Property(t => t.Note)

                .HasMaxLength(200)
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

